package com.example.venue_reservation_service.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.time.LocalDateTime;

@Document(collection = "chat_messages")
@Data
public class ChatMessage {
    @Id
    private String id;
    private String sender;
    private Integer senderRole;
    private String content;
    private LocalDateTime timestamp;

    public ChatMessage(String sender, Integer senderRole, String content) {
        this.sender = sender;
        this.senderRole = senderRole;
        this.content = content;
        this.timestamp = LocalDateTime.now();
    }
}